home *** CD-ROM | disk | FTP | other *** search
/ Champak 145 / (Vol 145) Dec 21 2011.iso / Games / hearts.swf / scripts / DefineSprite_568 / frame_82 / DoAction.as
Encoding:
Text File  |  2011-12-21  |  1.1 KB  |  47 lines

  1. stop();
  2. this.getScore = function()
  3. {
  4.    var t = this;
  5.    i = 1;
  6.    while(i < 11)
  7.    {
  8.       t["e" + i].rank = i + ".";
  9.       t["e" + i].name = "Loading...";
  10.       t["e" + i].score = "";
  11.       i++;
  12.    }
  13.    __top10_send__ = new LoadVars();
  14.    __top10_receive__ = new LoadVars();
  15.    __top10_url_1__ = "http://www.armorbot.com/flashcomm";
  16.    __top10_url_2__ = "/top10_b";
  17.    __top10_send__.hid = 682;
  18.    __top10_send__.kid = "XMUSUF";
  19.    __top10_send__.sendAndLoad(__top10_url_1__ + __top10_url_2__,__top10_receive__,"POST");
  20.    __top10_receive__.onLoad = function(success)
  21.    {
  22.       if(success)
  23.       {
  24.          i = 1;
  25.          while(i < 11)
  26.          {
  27.             t["e" + i].rank = i + ".";
  28.             t["e" + i].name = __top10_receive__["name" + i];
  29.             t["e" + i].score = __top10_receive__["score" + i];
  30.             i++;
  31.          }
  32.       }
  33.       else
  34.       {
  35.          i = 0;
  36.          while(i < 11)
  37.          {
  38.             t["e" + i].rank = i + ".";
  39.             t["e" + i].name = "Error loading scores...";
  40.             t["e" + i].score = "0000";
  41.             i++;
  42.          }
  43.       }
  44.    };
  45. };
  46. this.getScore();
  47.